home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / telecomm / bbs / tbbs093.lha / Programmer / TechWWF_src / CConv.asm < prev    next >
Assembly Source File  |  1994-04-07  |  557b  |  36 lines

  1. ; Character set conversion routine
  2.  
  3. ; void ConvString(__A0 UBYTE *src, __A1 UBYTE *dst, __A2 UBYTE *conv);
  4.  
  5.         xdef    @ConvString
  6.         xdef    @CRtoLF
  7.         xdef    @LFtoCR
  8.  
  9.         section    text,code
  10.  
  11. @ConvString    moveq    #0,d0
  12. cnvloop        move.b    (a0)+,d0
  13.         beq    nomore
  14.         move.b    0(a2,d0.w),d0
  15.         beq    cnvloop
  16.         move.b    d0,(a1)+
  17.         bra    cnvloop
  18. nomore        clr.b    (a1)
  19. cnomore        rts
  20.  
  21. @CRtoLF        move.b    (a0)+,d0
  22.         beq    cnomore
  23.         cmpi.b    #13,d0
  24.         bne    @CRtoLF
  25.         move.b    #10,-1(a0)
  26.         bra    @CRtoLF
  27.  
  28. @LFtoCR        move.b    (a0)+,d0
  29.         beq    cnomore
  30.         cmpi.b    #10,d0
  31.         bne    @LFtoCR
  32.         move.b    #13,-1(a0)
  33.         bra    @LFtoCR
  34.  
  35.         end
  36.